package com.apiz.controller;

import com.apiz.annotation.AuthCheck;
import com.apiz.common.BaseResponse;
import com.apiz.common.model.vo.InterfaceInfoVO;
import com.apiz.constant.UserConstant;
import com.apiz.service.UserInterfaceInfoService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

@RestController
@Slf4j
public class AnalysisController {

    @Resource
    private UserInterfaceInfoService userInterfaceInfoService;

    @GetMapping("/top/interface/invoke")
    @AuthCheck(mustRole = UserConstant.ADMIN_ROLE)
    public BaseResponse<List<InterfaceInfoVO>> listTopInvokeInterfaceInfo() {
        BaseResponse<List<InterfaceInfoVO>> result = userInterfaceInfoService.listTopInvokeInterfaceInfo();
        return result;
    }
}
